package com.jt.controller;

import com.jt.pojo.AxiosPojo;
import org.springframework.web.bind.annotation.*;

@RestController
//允许当前类中所有的方法跨域
@CrossOrigin
public class AxiosController {
    /*
    url:localhost:8080/hello
    * */
    @GetMapping ("/hello")
    public String hello(Integer id){
        return "vue的ajax的异步调用"+id;
    }
    @PostMapping("/hello")
    public AxiosPojo hellopost(@RequestBody AxiosPojo axiosPojo){
        return axiosPojo;
    }
}
